﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <!-- layui.css -->
    <script th:src="@{/js/jquery-2.2.4.min.js}"></script>
    <script th:src="@{/js/workutil.js}"></script>
    <link th:href="@{/plugin/layui/css/layui.css}" rel="stylesheet"/>
    <link th:href="@{/css/layui_custom.css}" rel="stylesheet"/>
</head>
<body>
<div class="">
    <!--内容区域 ajax获取-->
    <table class="layui-hide" id="table-projectall"></table>
</div>
<!-- layui.js -->
<script th:src="@{/plugin/layui/layui.js}"></script>
<!-- layui规范化用法 -->
<script type="text/javascript">
    layui.use('table', function () {
        var table = layui.table;
        table.render({
            elem: '#table-projectall'
            , url: '../project/projectall'
            , cols: [[{field: 'username', title: '创建者'}
                , {field: 'name', title: '项目名称', sort: true}
                , {field: 'deleted', title: '状态'}
                , {field: 'users', title: '用户数量'}
                , {field: 'created', title: '创建时间', sort: true}
                , {field: 'modified', title: '活跃时间', sort: true}
            ]]
            , id: 'testReload'
            , page: true
            ,pageauto:true
            , height: 'full-20',
            row: function (item) {
                item.deleted = (item.deleted == true ? "解散" : "正常");
                item.username = item.user.name;
                item.created = workUtils.toDate(item.created);
                item.modified = workUtils.toDate(item.modified);
                return item;
            }
        });
    });
</script>
</body>
</html>